package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;
import com.seuic.hnjiningposapp.hnapps.util.GetMoneyLvUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 他行现金汇款 确认信息
 */
public class OtherBanKCaPp extends BasePopupView {


    @BindView(R.id.make_name)
    TextView makeName;
    @BindView(R.id.bank_name)
    TextView bankName;
    @BindView(R.id.user_num)
    TextView userNum;
    @BindView(R.id.user_name)
    TextView userName;
    @BindView(R.id.make_money)
    TextView makeMoney;
    @BindView(R.id.sxf_tx)
    TextView sxfTx;
    @BindView(R.id.query_success_btn)
    Button querySuccessBtn;
    Unbinder bind;
    otherBnakCappOk mOtherBnakCappOk;
    @BindView(R.id.sure_deal_info_nobtn)
    Button sureDealInfoNobtn;

    public OtherBanKCaPp(@NonNull Context context) {
        super(context);
    }

    public OtherBanKCaPp(@NonNull Context context, otherBnakCappOk otherBnakCappOk) {
        super(context);
        mOtherBnakCappOk = otherBnakCappOk;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.other_bank_capp_layout;
    }


    String BankName;
    String usernum;
    String username;
    String make_money;
    String sxf_tv;

    public void setBankName(String bankName) {
        BankName = bankName;
    }

    public void setUsernum(String usernum) {
        this.usernum = usernum;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setMake_money(String make_money) {
        this.make_money = make_money;
    }

    public void setSxf_tv(String sxf_tv) {
        this.sxf_tv = sxf_tv;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);

        makeName.setText("他行现金汇款");
        bankName.setText(BankName);
        userNum.setText(usernum);
        userName.setText(username);
        makeMoney.setText(GetMoneyLvUtils.getInputMoney(make_money));
        sxfTx.setText(GetMoneyLvUtils.getMoney(sxf_tv));

    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    @OnClick({R.id.sure_deal_info_nobtn, R.id.query_success_btn})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.sure_deal_info_nobtn:
                mOtherBnakCappOk.OnLast();
                break;
            case R.id.query_success_btn:
                mOtherBnakCappOk.OtherSureinfonext();
                break;
        }
    }

    public interface otherBnakCappOk {
        void OtherSureinfonext();

        void OnLast();
    }

}
